package com.myhome.entity;

import lombok.*;
import lombok.experimental.Accessors;

@AllArgsConstructor
@NoArgsConstructor
@Setter
@Getter
@ToString
@Accessors(chain = true)
public class RespBean {
    private long code;
    private String message;
    private Object object;
    public static RespBean success(String message){
        return new RespBean(200L,message,null);
    }

    public static RespBean success(String message,Object object){
        return new RespBean(200,message,object);
    }

    public static RespBean error(String message){
        return new RespBean(500, message, null);
    }

    public static RespBean error(String message,Object object){
        int a=0;
        Integer b = 1;
        return new RespBean(500,message,object);

    }
}
